# encoding: utf-8

class AdminsController< ApplicationController
  layout :admin
  def login
    @current_user ||= Account.where(:oops_id => params[:oops_id]).first
    if @current_user
      session[:current_user] = @current_user._id
      cookies[:flowy_token] = @current_user._id
      render_msg :type => :success, :msg => "成功"
    else
      render_msg :type => :error, :error => "错误"
    end
  end
end